package com.myapp.api.tools;

public class JsonResult {
    private int status;

    private String message;

    private Object data = null;

    public JsonResult(ResultStatus record, String message, Object data) {
        this.setStatus(record);
        this.message = message;
        this.data = data;
    }

    public JsonResult(Object data) {
        this.setStatus(ResultStatus.SUCCESS);
        this.message = ResultStatus.SUCCESS.getMessage();
        this.data = data;
    }

    public JsonResult(ResultStatus record) {
        this.setStatus(record);
        this.message = record.getMessage();
    }

    public JsonResult(ResultStatus record, String message) {
        this.setStatus(record);
        this.message = message;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(ResultStatus record) {
        this.status = record.getStatus();
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
